import request from "@/utils/request";

// 获取用户列表（支持分页、搜索、排序）
export function getUserListApi(params: any) {
  return request({
    url: "api/users",
    method: "get",
    params,
  });
}

// 新增用户
export function addUserApi(data: any) {
  return request({
    url: "api/users",
    method: "post",
    data,
  });
}

// 编辑用户
export function editUserApi(data: any) {
  return request({
    url: `api/users/${data.ID}`,
    method: "put",
    data,
  });
}

// 删除用户
export function deleteUserApi(id: string) {
  return request({
    url: `api/users/${id}`,
    method: "delete",
  });
}